#include <buola/chart/cseries.h>

namespace buola { namespace chart {

void CSeries::CalcSeries()
{
    mMin.x=INFINITY;
    mMinPos.x=INFINITY;
    mMax.x=-INFINITY;
    
    mMin.y=INFINITY;
    mMinPos.y=INFINITY;
    mMax.y=-INFINITY;
    
    for(int i=0;i<mXData.size();i++)
    {
        mMin.x=min(mMin.x,mXData[i]);
        mMax.x=max(mMax.x,mXData[i]);
        mMin.y=min(mMin.y,mYData[i]);
        mMax.y=max(mMax.y,mYData[i]);
        if(mXData[i]>0) mMinPos.x=min(mMinPos.x,mXData[i]);
        if(mYData[i]>0) mMinPos.y=min(mMinPos.y,mYData[i]);
    }
}

/*namespace chart*/ } /*namespace buola*/ }
